package com.jeff.springWebTestNG.persistence.service;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Transactional(rollbackFor=RuntimeException.class)
public class BaseJdbcPersister {
	protected JdbcTemplate jdbcTemplate;
	private DataSource ds;
	@Resource
	@Qualifier("dataSource")
	public void setDs(DataSource ds) {
		this.ds = ds;
		jdbcTemplate = new JdbcTemplate(ds);
	}
}
